<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/view/common/taglibs.jsp"%>
<html>
	<head>
		<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
		<title>绩效分配-驻店顾问绩效分配</title>
		<script src="${contextPath}/scripts/jquery/jquery-1.8.3.min.js" type="text/javascript"></script>
		<script src="${contextPath}/scripts/common.js" type="text/javascript"></script>
		<script src="${contextPath}/scripts/scriptvalidator.js" type="text/javascript"></script>
		<link href="${contextPath}/styles/default.css" rel="stylesheet" type="text/css" />
		<script language='javascript'>
		<s:if test="resultBoolean && popMessage!= null">
			alert("${popMessage}");
		</s:if>
		 function go_back(){
		 	var url = "<s:property value='contextPath'/>/pm/assign/editShopDetail.do?currentPage=${currentPage}&entity.id=${entity.id}";
		 	location.href=url;
		 }
		 
		 
			function deleteData(id) {
				if(confirm("确认要删除吗?")) {
					//var searchForm = document.form1;
					//searchForm.action = "<s:property value='contextPath'/>/pm/assign/destoryAssignUser.do?assignUser.id="+id;
					//searchForm.submit();
					window.location.href="<s:property value='contextPath'/>/pm/assign/destoryAssignUser.do?assignUser.id="+id;
				}	  
			}
		 
			function checkSubmit(){
		     	var staffForm = document.form1;
				if(!Validator.Validate(staffForm, 3)) {
					return false;
				}

				return true;
			 }
		</script>
	</head>
	<body leftmargin='8' topmargin='8'>
		<div class="navigation">
	    <span><a href="javascript:go_back();"><img src="${contextPath}/images/back_nav_btn.png" /></a>
	    <a href="javascript:go_back();">返回</a>
	    <a href="javascript:window.history.forward();"><img src="${contextPath}/images/go_nav_btn.png" /></a>
	     <a href="javascript:window.history.forward();">前进</a>
	    <a href="<s:property value='contextPath'/>/pm/assign/editShopMonthDetail.do?monthEntity.id=<s:property value="monthEntity.id"/>"><img src="${contextPath}/images/refresh_nav_btn.png" /></a>
	     <a href="<s:property value='contextPath'/>/pm/assign/editShopMonthDetail.do?monthEntity.id=<s:property value="monthEntity.id"/>">刷新</a>
	    </span>绩效管理&gt;&gt;绩效分配&gt;&gt;店铺详情&gt;&gt;驻店顾问绩效分配
	    
   		 </div>
						<form name="form1" action="updateShopMonthDetail.do?monthEntity.id=<s:property value='monthEntity.id'/>"
							onsubmit="return checkSubmit();" method="post">   		 
		<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" >
			<tr>
				<td align="center" valign="top" bgcolor="#FFFFFF">
					<div class="xt_main_right_center">
	
							
		<table width="100%" border="0" cellpadding="1" cellspacing="1">
		<tr>
			<td class="left-td-width-bg">
				4S店:
			</td>
			<td class="right-td-width-bg-left">
				(<s:property value="monthEntity.performanceAssignShopDetail.shop.shopMark"/>)<s:property value="monthEntity.performanceAssignShopDetail.shop.shopName"/>
			</td>
			<td class="left-td-width-bg">
				发放月份：
			</td>
			<td class="right-td-width-bg-left">
				<s:property value="monthEntity.monthDate" />
			</td>			
			<td class="left-td-width-bg">
				可分配总额：
			</td>
			<td class="right-td-width-bg-left">
				<s:property value="formatAmount(monthEntity.performanceAssignShopDetail.totalAmount)"/>
			</td>
			<td class="left-td-width-bg">
				<font color="red">*</font>区域经理店绩效：
			</td>					
			<td class="right-td-width-bg-left">
				<s:if test="areaManager">
					${monthEntity.areaTotalAmount}
					<input type="hidden"  name="monthEntity.areaTotalAmount" value="<s:property value="formatAmount(monthEntity.areaTotalAmount)"/>"/>
				</s:if>
				<s:else>
				<input type="text" class="input" name="monthEntity.areaTotalAmount" value="<s:property value="formatAmount(monthEntity.areaTotalAmount)"/>"/>
				</s:else>
			</td>
		</tr>
		<tr>
			<td class="left-td-width-bg">
				备注：
			</td>
			
			<td class="right-td-width-bg-left" colspan="2">
				<input type="text" class="input" name="monthEntity.remark" value="${monthEntity.remark}"/>
			</td>	
			<td class="right-td-width-bg-left" colspan="5">
			<b>
				区域经理修改过金额的记录颜色为<font color="red">红色</font>，监管科修改过区域经理修改过的记录颜色为<font color="yellow">黄色</font>
			</b>
			</td>	
		</tr>
	</table>
						
	<br/><br/>
	
      <table width="100%" border="0" cellpadding="0" cellspacing="0" id="listTable">
		  <tr>
		    <td height="25" align="left"><font color="#0066CC"><strong>人员绩效列表：</strong></font></td>
		    <td height="25" align="right">
		  	  <a href="addAssignUser.do?monthEntity.id=<s:property value="monthEntity.id"/>"><img src="${contextPath}/images/btn_add.png" alt="新增" /></a>
            </td>
		  </tr>
		</table>
		      
        <table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#CCCCCC">
		  <tr>
    		        <td width="3%" class="top-td-width-bg">序号</td>
    		        <td width="8%" class="top-td-width-bg">工号 </td>
    		        <td width="8%" class="top-td-width-bg">驻店顾问 </td>
				    <td width="8%" class="top-td-width-bg"><font color="red">*</font>发放金额</td>
				    <td width="30%" class="top-td-width-bg"><s:if test="areaManager"><font color="red">*</font></s:if>备注</td>
			        <td width="5%" class="top-td-width-bg">操作</td>
		  </tr>
		  <tbody>
 <s:iterator value="monthEntity.assignUsers" status="s">
	<tr <s:if test="displayColor != null && displayColor != ''">style='background-color: ${displayColor}'</s:if>> 
	  <td <s:if test="displayColor == null || displayColor == ''">class="down-center-td-width-bg"</s:if> >${s.index+1}</td>
	  
	  <td <s:if test="displayColor == null || displayColor == ''">class="down-center-td-width-bg"</s:if>>
	  	<s:property value="user.jobNumber"/>
	  </td>
	  <td <s:if test="displayColor == null || displayColor == ''">class="down-center-td-width-bg"</s:if>>
	  	<s:property value="user.realName"/>
	  </td>
	  <td <s:if test="displayColor == null || displayColor == ''">class="down-center-td-width-bg"</s:if>>
	 	<input name="assignUserMaps[${id}].amount" value="${amount}" class="input" dataType="Require|Double"  msg="金额不能为空|请输入数字"></input>
	  </td>
	  <td <s:if test="displayColor == null || displayColor == ''">class="down-center-td-width-bg"</s:if>>
		  <input name="assignUserMaps[${id}].remark" value="${remark}" class="input" <s:if test="areaManager">dataType="Require"  msg="备注不能为空"</s:if> ></input>
	  </td>
	  <td class="down-center-td-width-bg">
<%-- 	    <a href="javascript:editData(<s:property value="id"/>);"><img src="${contextPath}/images/edit.gif" alt="编辑" width="16" height="13" border="0" /></a> --%>
	    <a href="javascript:deleteData(<s:property value="id"/>)"><img src="${contextPath}/images/del.gif" alt="删除" width="16" height="13" border="0" /></a>
	  </td>
	</tr>
</s:iterator>
</tbody>		  
		</table>	
					</div>
				</td>
			</tr>
		</table>
		<br/>
	 <table width="100%">
            	<tr>
                	<td><div align="center">
                	  <input type="submit" name="submit" value="  " class="btn_save" />
                	&nbsp;&nbsp;
                      <input type="reset" name="reset" value="  " class="btn_rest" onclick="clearForm(this.form);return false;"/>
                    </div>
                    </td>
                </tr>
     	</table>   	
</form>     		
		<br/><br/><br/><br/><br/>
		<div><jsp:include page="/include/footer.inc"></jsp:include></div>
	</body>
</html>